package com.cqupt.service;

import java.util.List;
import java.util.Map;

public interface ItemService {
    // 关于磁盘需要添加监控项的名称 "name"和对应的键值 "key"
    String diskWriteKey = "vfs.dev.write[,,]";
    String diskWriteName = "Disk write rate";
    String diskReadKey = "vfs.dev.read[,,]";
    String diskReadName = "Disk read rate";

    //Windows主机需要添加的磁盘监控项
    String Windows_diskWriteKey = "perf_counter[\\2\\18]";
    String Windows_diskWriteName = "Disk write rate(Windows)";
    String Windows_diskReadKey = "perf_counter[\\2\\16]";
    String Windows_diskReadName = "Disk read rate(Windows)";
    //cpu负载（1分钟） Load average (1m avg)
    String Windows_load_avg = "system.cpu.load[all,avg1]";
    String Windows_load_avg_name = "Load average (1m avg)";
    // windows 系统监控项
    String Windows_sys_log = "eventlog[System,,Warning|Error]";
    String Windows_sys_log_name = "System Log(Warning|Error)";
    //linux 系统监控项
    String Linux_sys_log = "log[/var/log/zabbix/zabbix_agentd.log]";
    String Linux_sys_log_name = "System Log";

    //启用单个监控项
    boolean enableMontiorItem(String itemid);
    //停用单个监控项
    boolean stopMontiorItem(String itemid);
    //删除监控项
    Map<String,Object> deleteMonitorItem(List<String> itemList);
    //获取指定主机的相关监控项
    List<Map<String,Object>> getAllItem(String hostId);
    //创建agent类型监控项
    Map<String,Object> creatMonitorItem(Map<String,Object> allNewsForItem,int type);
    //从xml文件中读取键值
    Map<String,List<Map<String,Object>>> getItemKeyFromXml();
    //创建主机时默认的监控项
    Map<String,Object> createItemInitHost(final String hostid,final String interfaceid);
    //创建主机时默认的snmp监控项
    Map<String,Object> createItemInitHostSNMP(final String hostid,final String interfaceid);
    //汉化初始化主机时的部分关键监控项，仅主机类型监控项
    void translateItemName();
    //批量停用监控项
    Map<String, Object> stopMontiorItems(List<String> itemList);
    // 添加部分初始监控项至模板
    Map<String, Object> createItemToTemplate(String templatesid,String key,String name);
    //删除模板的自定义（非初始）监控项
    Map<String, Object> deleteItemToTemplate(String templatesid,String key,String name);
    //根据主机id获取所需监控项
    List<Map<String,Object>> get_important_item_byid(String hostId, String token);
    // 高负载优化接口item
    List<Map<String,Object>> get_cup_and_mem_item_byid(String hostids, String token);
    // 获取所有的cpu监控项
    List<Map<String,Object>> get_cup_item( String token, List<String> hostids);
    // 获取所有的内存监控项
    List<Map<String,Object>> get_mem_item( String token, List<String> hostids);

    //通过hostid获得snmp设备的item信息
    List<Map<String,Object>> get_snmp_item_id(String hostId);
    // 设置新添加设备更新系统描述时间
    void setSystemDescDelayAs2s(String token, String hostid);
    // 重置更新时间
    void resetSystemDescDelay(String token, String hostid);
    //通过HostID获取主机组ID
    String getInterfaceidBuHostid(String hostid);

    Map<String, Object> get_cup_and_mem_disk_item_byid(String hostid, String token);
}
